<?php if (!defined('THINK_PATH')) exit();?><!-- 引入头部 -->
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>管理后台</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">


<!-- 新 Bootstrap 核心 CSS 文件 -->
<!--<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">-->
 <!-- Loading Bootstrap -->
<link href="/Public/FlatUI/css/vendor/bootstrap.min.css" rel="stylesheet">

<!-- Loading Flat UI -->
<link href="/Public/FlatUI/css/flat-ui.css" rel="stylesheet">


<link rel="shortcut icon" href="/Public/images/logo/1155606.png">

<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
<!--[if lt IE 9]>
  <script src="/Public/FlatUI/js/vendor/html5shiv.js"></script>
  <script src="/Public/FlatUI/js/vendor/respond.min.js"></script>
<![endif]-->

  <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="/Public/FlatUI/js/vendor/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/Public/FlatUI/js/flat-ui.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<!--<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>-->
<link rel="stylesheet" href="/Public/css/home.css">
 <style type="text/css">
  body {
    padding-top: 70px;

  }

</style>
</head>
<?php
 $currentURL = 'http'; if ($_SERVER["HTTPS"] == "on") { $currentURL .= "s"; } $currentURL .= "://"; if ($_SERVER["SERVER_PORT"] != "80") { $currentURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; } else { $currentURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]; } ?>
<!-- Static navbar -->
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
      </button>
      <a class="navbar-brand" href="#">
          <img src="/Public/images/logo/1155606.png" style="margin:0; padding:0;margin-top:-5px;" height="32px" width="32px">
          <font style="font-weight: bold; font-family: monospace;">beginner 管理后台</font>
        </a>
    </div>
    <div class="navbar-collapse collapse">

      <ul class="nav navbar-nav navbar-right">
        <li class=""><a href="<?php $_SERVER['SERVER_NAME']; ?>/index.php?m=Home&c=Index&a=index">返回主页</a></li>

        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">设置 <b class="caret"></b></a>
          <ul class="dropdown-menu">
            <li><a href="#">个人中心</a></li>
            <li><a href="#">修改密码</a></li>
          </ul>

        </li>
         <li>
            <a>欢迎您，<?php echo ($_SESSION['USERNAME4SESSION']); ?>&nbsp;&nbsp;</a>
        </li>
        <li>
            <a href="<?php echo U('Home/Index/logout');?>" data-toggle="modal"
               style="float:right; margin-left:-30px;">退出</a>
        </li>
      </ul>

    </div><!--/.nav-collapse -->
  </div>

</div>


<link rel="stylesheet" href="/Public/css/admin/index.css">
<script type="application/javascript" src="/Public/js/home/index.js"></script>
<style type="text/css">
body {
    font-size: 13px;
}
</style>
<!--  引入UEditor  -->

<!-- 配置文件 -->
<script type="text/javascript" src="/Public/ueditor_sae/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/Public/ueditor_sae/ueditor.all.js"></script>
<!--建议手动加载语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
<!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
<script type="text/javascript" charset="utf-8" src="/Public/ueditor_sae/lang/zh-cn/zh-cn.js"></script>

<!-- 实例化编辑器 -->
<script type="text/javascript">
    var ue = UE.getEditor('container');
    
    function gbcount(message, total, used, remain) {
        var max;
        var userSpan = document.getElementById(used);
        var totalSpan = document.getElementById(total);
        var remainSpan = document.getElementById(remain);
        max = totalSpan.innerHTML;
        if (message.value.length > max) {
            message.value = message.value.substring(0, max);
            //used.value = max;
            //remain.value = 0;
            userSpan.innerHTML=max;
            remainSpan.innerHTML=0;
            //alert("信息内容不能超过 120 个字!");
            // 设置摘要输入框为红色，提交按钮变为不可用
            //var zy = document.getElementById("zhaiyao");
            $("#zhaiyao").addClass("has-error");
            $("#submitId").attr("disabled", true);
        } else {

            userSpan.innerHTML = message.value.length;
            remainSpan.innerHTML = max - userSpan.innerHTML;
            // 设置摘要输入框的红色，提交按钮变为可用
            $("#zhaiyao").removeClass("has-error");
            $("#submitId").attr("disabled", false);
        }
    }

    function checkForm() {
        // 有空再写校验
        return true;
    }
</script>

<body>


<div class="container-fluid">

<!-- 首先屏幕分为2列 -->
<div class="row">
<!--    左则的菜单栏 -->
   
<div class="col-md-2 col-sm-2">
    <div class="list-group">
      <a href="<?php echo U('Home/Index/index');?>" class="list-group-item">
        发表文章
      </a>
      <a href="<?php echo U('Home/Index/articleType');?>" class="list-group-item">文章分类</a>
    </div>
</div>


    <!-- 如果是中大屏幕则分为2列，在小屏幕就显示一列 -->
    <div class="col-md-10 col-sm-10 col-xs-12">
        <div class="panel panel-default">
          <div class="panel-heading" style="height:40px;">
              <div class="row">
                  <div class="col-sm-3 my-breadcrumb"><span class="">文章 > 发表文章</span></div>
                  <div class="col-sm-2 col-sm-offset-7">
                      <a class="btn btn-info active " style="padding:4px 8px;" href="<?php echo U('Home/Index/index');?>">
                        返回文章列表
                      </a>
                  </div>
              </div>
          </div>
        </div>


        <div class="main-content">
        <!--<?php echo $ct['id'];?>-->
            <form name="addArt" id="addArt" method="post"
                  class="form-horizontal" role="form" onsubmit="return checkForm();">
                <input type="hidden" name="id" id="id" value="<?php echo $ct['id'];?>">
              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">标题<font color="red"> *</font></label>
                <div class="col-sm-10">
                  <input type="text" class="form-control" id="title" name="title"
                         value = "<?php echo $ct['title'];?>" placeholder="请输入文章标题">
                </div>
              </div>
              <div class="form-group">
                <label for="inputEmail3" class="col-sm-2 control-label">文章类型<font color="red"> *</font></label>
                <div class="col-sm-4">
                  <select class="form-control" name="cont_type">
                      <?php if(is_array($typeList)): $i = 0; $__LIST__ = $typeList;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo ($vo["type_no"]); ?>" <?php if($vo['type_no'] == $ct['cont_type']): ?>selected="selected"<?php endif; ?> ><?php echo ($vo["type_name"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                    </select>
                </div>
              </div>
              <div class="form-group" id="zhaiyao">
                <label for="inputEmail3" class="col-sm-2 control-label">文章摘要<font color="red"> *</font></label>
                <div class="col-sm-10">
                    <input type="text" class="form-control" id="title" name="ctt_summary"
                         value = "<?php echo $ct['ctt_summary'];?>" placeholder="请输入文章摘要，不超过120个字。"
                           onkeydown="gbcount(document.addArt.ctt_summary,'total','used','remain');"
                           onkeyup="gbcount(document.addArt.ctt_summary,'total','used','remain');">
                    <span id="helpBlock" class="help-block">
                       摘要最多字数：<span name="total" id="total" value="120">120</span>
					    已经输入字数：<span name="used" id="used" value="0">0</span>
	                   剩余字数：<span name="remain" id="remain"  value="0">120</span>
                </div>
              </div>
              <div class="form-group">
                <label for="inputPassword3" class="col-sm-2 control-label">内容</label>
                <div class="col-sm-10">
                  <!-- 加载编辑器的容器 -->
                    <script id="container" name="content" type="text/plain">
                        <?php echo (htmlspecialchars_decode($ct['content'])); ?>
                    </script>
                    <div>
                        为了在小屏幕的设备上保持图片的比例请在插入图片的HTML代码上一个属性：
                        <font color="red">class="img-responsive"</font> <br>
                        比如:&lt;img class="img-responsive" src="1419347160195971.jpg" title="" alt="" /&gt;
                    </div>
                </div>
              </div>

              <div class="form-group container">
               <div class="col-sm-offset-4 col-sm-8">
                  <button type="submit" class="btn btn-info" id="submitId">保存</button>
                   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <button type="reset" id="emptyContent" class="col-xs-offset-3 col-sm-offset-2 col-md-offset-2 col-lg-offset-2 btn btn-default">清空内容</button>
                </div>
              </div>
            </form>

        </div> <!-- main-content -->
</div>

</div>  <!-- /row -->

</div> <!-- /container -->

</body>

<!-- 引入尾部 -->

<center>
<div class="container-fluid my-container-style">
    <footer class="footer" style="color:#000; padding-top:15px;">
        <p>
            CopyRight ©2014，Site Build By Ubuntuvim.
        </p>
        <p>
            广西梧州富民三路82号
        </p>
    </footer>
</div>
</center>